package com.jay.lang.intf;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class AutoCloseableIntf {

	static class TestFile {
		public void process() throws IOException {

			try (FileInputStream in = new FileInputStream("xanadu.txt");
					FileOutputStream out = new FileOutputStream("outagain.txt")) {

				int c;

				while ((c = in.read()) != -1)
					out.write(c);
			}
		}
	}

	public static void main(String[] args) throws IOException {
		TestFile tf = new TestFile();
		tf.process();
	}
}
